﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DTO;
using BUS;
namespace TuyenDungViecLam.User_control
{
    public partial class Fast_Search : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ListItem item = new ListItem();
                item.Text = "Bất kỳ ngành nghề";
                item.Value = "0";

                DDnganhnghe.DataSource = NganhNghe_BUS.DanhSachCacNganhNghe();
                DDnganhnghe.DataTextField = "TenNganh";
                DDnganhnghe.DataValueField = "MaNganhNghe";
                DDnganhnghe.DataBind();
                DDnganhnghe.Items.Insert(0, item);

                DDdiadiem.DataSource = ChiTietCongViec_BUS.DanhSachNoiLamViec();
                DDdiadiem.DataTextField = "Ten";
                DDdiadiem.DataValueField = "MaTinhThanh";
                DDdiadiem.DataBind();
                ListItem item1 = new ListItem();
                item1.Text = "Tất cả địa điểm";
                item1.Value = "0";
                DDdiadiem.Items.Insert(0, item1);
            }
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            string Mng = "";
            string Mnlv = "";
            string TuKhoa = "";
            TuKhoa = tbtukhoa.Text.ToString();
            ListItem ct = DDnganhnghe.Items[DDnganhnghe.SelectedIndex];
            Mng = ct.Value;
            ListItem nlv = DDdiadiem.Items[DDdiadiem.SelectedIndex];
            Mnlv = nlv.Value;
            //lbtimkiem.PostBackUrl = "../VN/KetQuaTimKiem.aspx?Search=1" + "&Tukhoa=" + TuKhoa + "&Mng=" + Mng + "&Mnlv=" + Mnlv;
            Response.Redirect("../VN/KetQuaTimKiem.aspx?Search=1" + "&Tukhoa=" + TuKhoa + "&Mng=" + Mng + "&Mnlv=" + Mnlv);
           
        }

        protected void bttimkiem_Click(object sender, EventArgs e)
        {
            string Mng = "";
            string Mnlv = "";
            string TuKhoa = "";
            TuKhoa = tbtukhoa.Text.ToString();
            ListItem ct = DDnganhnghe.Items[DDnganhnghe.SelectedIndex];
            Mng = ct.Value;
            ListItem nlv = DDdiadiem.Items[DDdiadiem.SelectedIndex];
            Mnlv = nlv.Value;
            Response.Redirect("../VN/KetQuaTimKiem.aspx?Search=1" + "&Tukhoa=" + TuKhoa + "&Mng=" + Mng + "&Mnlv=" + Mnlv);
        }

        
    }
}